import getlink from "@/api/getapi.js"
// Vue.use(Vuex)
let shangcheng = {
    // export default new Vuex.Store({
    state: {
        arr: [],
        arre:[]
        
    },
    mutations: {
        newarr(state, payload) {
            state.arr = payload.xinarr
        },
        tarr(state,payload){
            state.arre=payload.xarr
        }


    },
    actions: {
        userdata(context, payload) {
            console.log(context);
            getlink(payload.url).then((ok) => {
                // console.log(ok);
                context.commit("newarr", { xinarr: ok.data.data })
                console.log(ok.data.data);
            });
        },
        gdata(context, payload) {
            getlink(payload.type).then((ok) => {
                context.commit("tarr", { xarr: ok.data.data })
                console.log(ok.data.data);
            })
        }

    },
    modules: {

    }
}
export default shangcheng